Skip to content

Port #[rustc_skip_during_method_dispatch] to the new attribute system #142695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GrigorenkoPV
Copy link
Contributor

@GrigorenkoPV GrigorenkoPV commented Jun 18, 2025

Part of #131229

r? @jdonszelmann

@rustbot
Copy link
Collaborator

rustbot commented Jun 18, 2025

jdonszelmann is currently at their maximum review capacity.
They may take a while to respond.

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 18, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 18, 2025

Some changes occurred in compiler/rustc_attr_data_structures

cc @jdonszelmann

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann

@@ -1093,22 +1094,11 @@ fn trait_def(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::TraitDef {
let rustc_coinductive = tcx.has_attr(def_id, sym::rustc_coinductive);
let is_fundamental = tcx.has_attr(def_id, sym::fundamental);

// FIXME: We could probably do way better attribute validation here.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe, fixed the fixme :)

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 18, 2025
@GrigorenkoPV GrigorenkoPV force-pushed the attributes/rustc_skip_during_method_dispatch branch from 84a4a9a to e015bc7 Compare June 18, 2025 22:11
@GrigorenkoPV
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 18, 2025
@bors
Copy link
Collaborator

bors commented Jun 19, 2025

☔ The latest upstream changes (presumably #142697) made this pull request unmergeable. Please resolve the merge conflicts.

@GrigorenkoPV GrigorenkoPV force-pushed the attributes/rustc_skip_during_method_dispatch branch from e015bc7 to 961a2cd Compare June 19, 2025 15:29
@@ -310,6 +322,24 @@ impl<'f, 'sess: 'f, S: Stage> AcceptContext<'f, 'sess, S> {
},
})
}

pub(crate) fn expect_no_args(&self, args: &ArgParser<'_>) -> Result<(), ErrorGuaranteed> {
if let Some(span) = match args {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for #[cold] I implemented this exact method. Could you rebase on that branch? Unfortunately it's taking a bit for everything to merge in. #142491

@bors
Copy link
Collaborator

bors commented Jun 20, 2025

☔ The latest upstream changes (presumably #142770) made this pull request unmergeable. Please resolve the merge conflicts.

@GrigorenkoPV GrigorenkoPV force-pushed the attributes/rustc_skip_during_method_dispatch branch from 961a2cd to 6e29774 Compare June 21, 2025 13:38
@bors
Copy link
Collaborator

bors commented Jun 21, 2025

☔ The latest upstream changes (presumably #142826) made this pull request unmergeable. Please resolve the merge conflicts.

@GrigorenkoPV GrigorenkoPV force-pushed the attributes/rustc_skip_during_method_dispatch branch from 6e29774 to 48290c7 Compare June 21, 2025 18:55
attribute: self.attr_path.clone(),
reason: AttributeParseErrorReason::ExpectedNoArgs,
})
pub(crate) fn expect_no_args(&self, args: &ArgParser<'_>) -> Result<(), ErrorGuaranteed> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like this method, it's different from all the other ones on here, and other parsers already solve this issue just inline. I don't really want the context to do any parsing really. I just want the methods to emit the errors, parsing happens in the parser.

@GrigorenkoPV
Copy link
Contributor Author

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 22, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@bors
Copy link
Collaborator

bors commented Jun 22, 2025

☔ The latest upstream changes (presumably #142878) made this pull request unmergeable. Please resolve the merge conflicts.

@GrigorenkoPV GrigorenkoPV force-pushed the attributes/rustc_skip_during_method_dispatch branch from 48290c7 to b830801 Compare June 22, 2025 21:25
@GrigorenkoPV
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 22, 2025
/// Assert that there were no args.
/// If there were, get a span to the arguments
/// (to pass to [`AcceptContext::expected_no_args`](crate::context::AcceptContext::expected_no_args)).
pub fn no_args(&self) -> Result<(), Span> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@GrigorenkoPV GrigorenkoPV force-pushed the attributes/rustc_skip_during_method_dispatch branch from b830801 to 0b69b02 Compare June 23, 2025 16:35
@GrigorenkoPV GrigorenkoPV force-pushed the attributes/rustc_skip_during_method_dispatch branch from 0b69b02 to aa80a2b Compare June 23, 2025 19:48
@jdonszelmann
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 23, 2025

📌 Commit aa80a2b has been approved by jdonszelmann

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 23, 2025
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jun 24, 2025
…_during_method_dispatch, r=jdonszelmann

Port `#[rustc_skip_during_method_dispatch]` to the new attribute system

Part of rust-lang#131229

r? `@jdonszelmann`
bors added a commit that referenced this pull request Jun 24, 2025
Rollup of 8 pull requests

Successful merges:

 - #140622 (compiletest: Improve diagnostics for line annotation mismatches)
 - #142641 (Generate symbols.o for proc-macros too)
 - #142695 (Port `#[rustc_skip_during_method_dispatch]` to the new attribute system)
 - #142742 ([win][aarch64] Fix linking statics on Arm64EC, take 2)
 - #142894 (phantom_variance_markers: fix identifier usage in macro)
 - #142928 (Fix hang in --print=file-names in bootstrap)
 - #142930 (Account for beta revisions when normalizing versions)
 - #142932 (rustdoc-json: Keep empty generic args if parenthesized)

r? `@ghost`
`@rustbot` modify labels: rollup
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jun 24, 2025
…_during_method_dispatch, r=jdonszelmann

Port `#[rustc_skip_during_method_dispatch]` to the new attribute system

Part of rust-lang#131229

r? ``@jdonszelmann``
bors added a commit that referenced this pull request Jun 24, 2025
Rollup of 9 pull requests

Successful merges:

 - #140005 (Set MSG_NOSIGNAL for UnixStream)
 - #140622 (compiletest: Improve diagnostics for line annotation mismatches)
 - #142354 (Fixes firefox copy paste issue)
 - #142695 (Port `#[rustc_skip_during_method_dispatch]` to the new attribute system)
 - #142779 (Add note about `str::split` handling of no matches.)
 - #142894 (phantom_variance_markers: fix identifier usage in macro)
 - #142928 (Fix hang in --print=file-names in bootstrap)
 - #142932 (rustdoc-json: Keep empty generic args if parenthesized)
 - #142933 (Simplify root goal API of solver a bit)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants